package com.example.Project.Class;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.gson.JsonObject;

import java.io.Serializable;

public class User implements Serializable {
    private static final long serialVersionUID = 1L;
    @JsonProperty("id")
    private int Id;
    @JsonProperty("name")
    private String Name;
    @JsonProperty("sex")
    private String Sex;
    @JsonProperty("phone")
    private String Phone;
    public User(){}

    public User(int Id, String Name, String Sex, String Phone) {
        this.Id = Id;
        this.Name = Name;
        this.Sex = Sex;
        this.Phone = Phone;
    }

    public int getId() {
        return this.Id;
    }

    public String getName() {
        return this.Name;
    }


    public String getSex() {
        return this.Sex;
    }

    public String getPhone() {
        return this.Phone;
    }
    public JsonObject toJsonObject(){
        JsonObject jsonContent = new JsonObject();

        jsonContent.addProperty("id",this.Id);
        jsonContent.addProperty("name",this.Name);
        jsonContent.addProperty("sex",this.Sex);
        jsonContent.addProperty("phone",this.Phone);
        return jsonContent;
    }

    public void setName(String name) {
        Name = name;
    }

    public void setPhone(String phone) {
        Phone = phone;
    }

    public void setType(String sex) {Sex = sex;}
}
